{template "","header"}
<script type="text/javascript" src="{JS_PATH}108wo/dropmenu.js"></script>
<script type="text/javascript">
	function update_price(obj, id)
	{
		$.getJSON('{APP_PATH}index.php?m=order&c=order_detail&a=update_price', {id:id, ajax:1}, function(data){
			$(obj).parent().html('<span>报价中...</span>');
		});
	}

	function changeNote(obj, id, note)
	{
		$('#td_'+id).html('<form action="" method="GET" onsubmit="return noteSubmit('+id+');"><input type="text" name="note" id="note_'+id+'" value="'+note+'" /> <input type="submit" value="确认" /> <input type="button" value="取消" onclick="noteCancel('+id+', \''+note+'\');" /></form>');
		$('#note_'+id).focus();
	}

	function noteSubmit(id)
	{
		var note = $('#note_'+id).val();
		$('#td_'+id).find('input:button').attr('disabled', true);
		$('#td_'+id).find('input:submit').attr('disabled', true);
		$.getJSON('{APP_PATH}index.php?m=order&c=order_detail&a=update_note', {ajax:1, id:id, note:note}, function(data){
			$('#td_'+id).html((note == '' ? "暂无备注" : note)+' <a href="javascript:void(0);" onclick="return changeNote(this, '+id+', \''+note+'\');"  style="color:#999;">[修改]</a>');
		});
		return false;
	}

	function noteCancel(id, note)
	{
		$('#td_'+id).html((note == '' ? "暂无备注" : note)+' <a href="javascript:void(0);" onclick="return changeNote(this, '+id+', \''+note+'\');" style="color:#999;">[修改]</a>');
	}
</script>
<script type="text/javascript">
//转发好友
$(function(){
	$(".copy").fancybox({
		'width'				: 600,
		'height'			: 350,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
})
</script>
	<div id="main">
		<div class="user">
			{template '', 'account_manage_left'}
			<div class="right">
				<div class="po">当前位置：会员中心 > <span>清单查看</span></div>
				<div class="listView">
					<ul class="info">
						<span>[{$order[oid]}]<b class="font14">{$order[title]}</b></span>创建时间：{date('Y-m-d H:i:s', $order[inputtime])}
					</ul>
					<ul class="clearit"></ul>
					<ul class="subMenu">　
						{php $i=1}
						{loop $topcategorys $r}
						<a href="{APP_PATH}index.php?m=order&c=order_detail&a=lists&id={$order[id]}&topcatid={$r[catid]}" {if $_GET[topcatid]==$r[catid]}class="current"{/if}}class="current">{$r[catname]}</a>[{$r[productnum]}]{if $i!=count($topcategorys)}　|　{/if}
						{php $i++}
						{/loop}
						<a href="{APP_PATH}index.php?m=order&c=index&a=update_note&id={$order[id]}" class="btn" title="{$order[note]}">清单备忘录</a>
					</ul>	
					<table cellpadding="0" cellspacing="1">
						<thead>
							<tr>
								<td width="15%" align="center">缩略图</td>
								<td width="38%">备注及价格</td>
								<td width="20%">供应商</td>
								<!--<td width="12%">参考价格</td>-->
								<td width="17%">联系电话</td>
								<td align="center">操作</td>
							</tr>
						</thead>
						<tbody>
							{if !$order_detail_data}
								<tr>
									<td colspan="5" align="center"><span class="b red">暂时还没有添加产品！</span></td>
								</tr>
							{/if}
							{loop $order_detail_data $v}
							<tr>
								<td align="center"><a href="{APP_PATH}{$v[thumb]}#{$v[productid]}_{$v[catid]}_{$v[bid]}" rel="photoGroup" rel="group1" title="{$v[producttitle]}"><img src="{thumb(APP_PATH.$v[thumb], 80, 55)}" width="80" height="55"/></a></td>
								<td id="td_{$v[id]}">{if $v[note]==""}暂无备注{else}{$v[note]}{/if}　<a href="javascript:void(0);" onclick="return changeNote(this, {$v[id]}, '{$v[note]}');" style="color:#999;">[修改]</a></td>
								<td>
									<a href="javascript:void(0);" rel="dropmenu1">{$v[companyname]}</a>
									<div class="dropmenudiv" id="dropmenu1">
										<ul>称呼：<b>{$v[nickname]}</b></ul>
										<ul><a target=blank href=http://wpa.qq.com/msgrd?V=1&Uin={$v[qq]}&Site=eydns.com&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=4:{$v[qq]}:4 alt=点击这里给我发消息>{$v[qq]}</a></ul>
									</div>
								</td>
								<!--<td align="center">{if $v[enquiry]==0}<a href="javascript:void(0);" onclick="update_price(this, {$v[id]});" class="green">立即询价</a>{elseif $v[enquiry]==1}<span>报价中...</span>{else}{$v[price]}{/if}</td>-->
								<td>{$v[tel]}</td>
								<td align="center">
									<a href="javascript:void(0);" title="查看" onclick="$(this).parent().parent().find('a[rel=photoGroup]').click();"><img src="{IMG_PATH}108wo/icon_view.gif" /></a><span>|</span>
									<a href="{APP_PATH}index.php?m=order&c=order_detail&a=delete&id={$v[id]}" title="删除" onclick="return confirm('确认删除？');"><img src="{IMG_PATH}108wo/icon_delete.gif" /></a>
								</td>
							</tr>
							{/loop}
						</tbody>
						{if $order_detail_pages}
						<tfoot>
							<tr>
								<td colspan="5">
									<div class="pageList">
										{$order_detail_pages}
									</div>
								</td>
							</tr>
						</tfoot>
						{/if}
						<tfoot>
							<tr>
								<td colspan="5">
								<a href="{APP_PATH}index.php?m=order&c=index&a=download&id={$order[id]}" class="downloadBtn">下载清单</a>
									<a href="{APP_PATH}index.php?m=order&c=index&a=copy&id={$order[id]}" class="downloadBtn copy" style="margin-right:20px;">转发好友</a>
										
								</td>
							</tr>
						</tfoot>
					</table>
				</div>
			</div>
			<div class="clearit"></div>
		</div>
	</div>
</div>
{template "","footer"}